3.48 \(\int \frac{\tan ^3(c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=74 \[ -\frac{\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{3 i \tan (c+d x)}{2 a d}-\frac{\log (\cos (c+d x))}{a d}+\frac{3 i x}{2 a} \]

[Out]

(((3*I)/2)*x)/a - Log[Cos[c + d*x]]/(a*d) - (((3*I)/2)*Tan[c + d*x])/(a*d) - Tan[c + d*x]^2/(2*d*(a + I*a*Tan[
c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0679656, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3550, 3525, 3475} \[ -\frac{\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac{3 i \tan (c+d x)}{2 a d}-\frac{\log (\cos (c+d x))}{a d}+\frac{3 i x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

(((3*I)/2)*x)/a - Log[Cos[c + d*x]]/(a*d) - (((3*I)/2)*Tan[c + d*x])/(a*d) - Tan[c + d*x]^2/(2*d*(a + I*a*Tan[
c + d*x]))

Rule 3550

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((b
*c - a*d)*(c + d*Tan[e + f*x])^(n - 1))/(2*a*f*(a + b*Tan[e + f*x])), x] + Dist[1/(2*a^2), Int[(c + d*Tan[e +
f*x])^(n - 2)*Simp[a*c^2 + a*d^2*(n - 1) - b*c*d*n - d*(a*c*(n - 2) + b*d*n)*Tan[e + f*x], x], x], x] /; FreeQ
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[n, 1]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\tan ^3(c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan (c+d x) (2 a-3 i a \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac{3 i x}{2 a}-\frac{3 i \tan (c+d x)}{2 a d}-\frac{\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan (c+d x) \, dx}{a}\\ &=\frac{3 i x}{2 a}-\frac{\log (\cos (c+d x))}{a d}-\frac{3 i \tan (c+d x)}{2 a d}-\frac{\tan ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [B]  time = 1.05023, size = 174, normalized size = 2.35 \[ -\frac{i \cos (c) \sec (c+d x) (\cos (d x)+i \sin (d x)) \left (-4 d x \tan ^2(c)+(-4-4 i \tan (c)) \tan ^{-1}(\tan (d x))-2 i d x \tan (c)+4 d x \sec ^2(c)-i \tan (c) \sin (2 d x)-2 i \log \left (\cos ^2(c+d x)\right )+(\tan (c)+i) \cos (2 d x)+4 \sec (c) \sin (d x) \sec (c+d x)+2 \tan (c) \log \left (\cos ^2(c+d x)\right )+4 i \tan (c) \sec (c) \sin (d x) \sec (c+d x)-6 d x+\sin (2 d x)\right )}{4 d (a+i a \tan (c+d x))} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + I*a*Tan[c + d*x]),x]

[Out]

((-I/4)*Cos[c]*Sec[c + d*x]*(Cos[d*x] + I*Sin[d*x])*(-6*d*x - (2*I)*Log[Cos[c + d*x]^2] + 4*d*x*Sec[c]^2 + 4*S
ec[c]*Sec[c + d*x]*Sin[d*x] + Sin[2*d*x] + ArcTan[Tan[d*x]]*(-4 - (4*I)*Tan[c]) - (2*I)*d*x*Tan[c] + 2*Log[Cos
[c + d*x]^2]*Tan[c] + (4*I)*Sec[c]*Sec[c + d*x]*Sin[d*x]*Tan[c] - I*Sin[2*d*x]*Tan[c] - 4*d*x*Tan[c]^2 + Cos[2
*d*x]*(I + Tan[c])))/(d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.022, size = 73, normalized size = 1. \begin{align*}{\frac{-i\tan \left ( dx+c \right ) }{ad}}-{\frac{{\frac{i}{2}}}{ad \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{5\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{4\,ad}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{4\,ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+I*a*tan(d*x+c)),x)

[Out]

-I/d/a*tan(d*x+c)-1/2*I/d/a/(tan(d*x+c)-I)+5/4/d/a*ln(tan(d*x+c)-I)-1/4/d/a*ln(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.28772, size = 278, normalized size = 3.76 \begin{align*} \frac{10 i \, d x e^{\left (4 i \, d x + 4 i \, c\right )} +{\left (10 i \, d x + 9\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 4 \,{\left (e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 1}{4 \,{\left (a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(10*I*d*x*e^(4*I*d*x + 4*I*c) + (10*I*d*x + 9)*e^(2*I*d*x + 2*I*c) - 4*(e^(4*I*d*x + 4*I*c) + e^(2*I*d*x +
 2*I*c))*log(e^(2*I*d*x + 2*I*c) + 1) + 1)/(a*d*e^(4*I*d*x + 4*I*c) + a*d*e^(2*I*d*x + 2*I*c))

________________________________________________________________________________________

Sympy [A]  time = 1.01913, size = 121, normalized size = 1.64 \begin{align*} \begin{cases} \frac{e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (\frac{\left (5 i e^{2 i c} - i\right ) e^{- 2 i c}}{2 a} - \frac{5 i}{2 a}\right ) & \text{otherwise} \end{cases} + \frac{5 i x}{2 a} - \frac{\log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} + \frac{2 e^{- 2 i c}}{a d \left (e^{2 i d x} + e^{- 2 i c}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise((exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*((5*I*exp(2*I*c) - I)*exp(-2*I*c)/(
2*a) - 5*I/(2*a)), True)) + 5*I*x/(2*a) - log(exp(2*I*d*x) + exp(-2*I*c))/(a*d) + 2*exp(-2*I*c)/(a*d*(exp(2*I*
d*x) + exp(-2*I*c)))

________________________________________________________________________________________

Giac [A]  time = 1.80923, size = 95, normalized size = 1.28 \begin{align*} -\frac{\frac{\log \left (\tan \left (d x + c\right ) + i\right )}{a} - \frac{5 \, \log \left (-i \, \tan \left (d x + c\right ) - 1\right )}{a} + \frac{4 i \, \tan \left (d x + c\right )}{a} + \frac{5 \, \tan \left (d x + c\right ) - 3 i}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(log(tan(d*x + c) + I)/a - 5*log(-I*tan(d*x + c) - 1)/a + 4*I*tan(d*x + c)/a + (5*tan(d*x + c) - 3*I)/(a*
(tan(d*x + c) - I)))/d